package com.xbongbong.pro.enums.businessrule.enums;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.xbongbong.paas.enums.FieldTypeEnum;
import com.xbongbong.saas.enums.XbbRefTypeEnum;
import com.xbongbong.saas.enums.business.AssembleEnum;
import com.xbongbong.saas.enums.business.BomBillEnum;
import com.xbongbong.saas.enums.business.ClueEnum;
import com.xbongbong.saas.enums.business.CompetitorEnum;
import com.xbongbong.saas.enums.business.ContactEnum;
import com.xbongbong.saas.enums.business.ContractEnum;
import com.xbongbong.saas.enums.business.ContractOutstockEnum;
import com.xbongbong.saas.enums.business.CustomerCommunicateEnum;
import com.xbongbong.saas.enums.business.CustomerManagementEnum;
import com.xbongbong.saas.enums.business.InstockEnum;
import com.xbongbong.saas.enums.business.InventoryEnum;
import com.xbongbong.saas.enums.business.InvoiceEnum;
import com.xbongbong.saas.enums.business.MarketActivityEnum;
import com.xbongbong.saas.enums.business.OutstockEnum;
import com.xbongbong.saas.enums.business.PaySheetEnum;
import com.xbongbong.saas.enums.business.PaymentSheetEnum;
import com.xbongbong.saas.enums.business.ProductionInstockEnum;
import com.xbongbong.saas.enums.business.ProductionMaterielOutstockEnum;
import com.xbongbong.saas.enums.business.ProductionOrderEnum;
import com.xbongbong.saas.enums.business.PurchaseEnum;
import com.xbongbong.saas.enums.business.PurchaseInstockEnum;
import com.xbongbong.saas.enums.business.PurchaseInvoiceEnum;
import com.xbongbong.saas.enums.business.QuotationEnum;
import com.xbongbong.saas.enums.business.RefundEnum;
import com.xbongbong.saas.enums.business.RefundInstockEnum;
import com.xbongbong.saas.enums.business.ReturnedMaterielInstockEnum;
import com.xbongbong.saas.enums.business.ReturnedPurchaseEnum;
import com.xbongbong.saas.enums.business.ReturnedPurchaseOutstockEnum;
import com.xbongbong.saas.enums.business.SalesOpportunityEnum;
import com.xbongbong.saas.enums.business.SupplierCommunicateEnum;
import com.xbongbong.saas.enums.business.SupplierContactEnum;
import com.xbongbong.saas.enums.business.SupplierEnum;
import com.xbongbong.saas.enums.business.TransferEnum;
import com.xbongbong.saas.enums.business.WarehouseEnum;
import com.xbongbong.saas.enums.business.WorkOrderEnum;
import lombok.Getter;

import java.util.Objects;

/**
 * 业务规则-过滤条件
 * @references: https://xbb.yuque.com/lfwuxq/vsf9sv/ctyt57
 * @author xingxing.xiao
 * @date 2020/06/10 10:16
 */
@Getter
public enum RuleConditionBusinessFieldEnum {

    /**
     * 客户管理 - businessType: 100
     *       NAME -> text_1 -> 客户名称                 NAME_SHORT -> text_2 -> 客户简称                PHONE -> subForm_1 -> 客户电话(不支持)            ADDRESS -> address_1 -> 客户地址            TYPE -> text_4 -> 客户状态              CUSTOMER_STAGE -> text_18 -> 客户阶段
     *       WASTAGE -> text_19 -> 流失原因             WASTAGE_MEMO -> text_22 -> 流失备注             OWNER_ID -> ownerId -> 负责人(不支持)            COUSERID -> coUserId -> 协同人(不支持)       SEX -> text_23 -> 性别                  BIRTHDAY -> text_21 -> 客户生日(不支持)
     *       QQ -> text_24 -> QQ                       WE_CHRT -> text_25 -> 微信                     ADD_CONTACT -> array_1 -> 添加联系人(不支持)      GENRE -> text_3 -> 客户类型                 IS_INDIVIDUAL -> text_5 -> 客户性质      SCALE -> text_6 -> 客户分级
     *       INDUSTRY -> text_7 -> 客户行业             IMPORTANT_DEGREE -> num_1 -> 重要程度(☆)       SOURCE -> text_9 -> 客户来源                     WEBSITE -> text_10 -> 客户官网              INSTRUCTION -> text_11 -> 客户简介       COUNTRY -> text_8 -> 国家
     *       HOBBIES -> text_26 -> 爱好                IMAGE -> file_1 -> 图片(不支持)                 FILE -> file_2 -> 文件(不支持)                   MEMO -> text_13 -> 备注                     CREATOR -> text_16 -> 创建人(不支持)      ADD_TIME -> addTime -> 创建时间
     *       UPDATE_TIME -> updateTime -> 更新时间      LAST_CONNECT_TIME -> date_2 -> 最后跟进时间(不支持)
     */
    CUSTOMER_MANAGEMENT(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode(), new String[]{CustomerManagementEnum.NAME.getAttr(), CustomerManagementEnum.NAME_SHORT.getAttr(), CustomerManagementEnum.ADDRESS.getAttr(), CustomerManagementEnum.TYPE.getAttr(), CustomerManagementEnum.CUSTOMER_STAGE.getAttr(),
            CustomerManagementEnum.WASTAGE.getAttr(), CustomerManagementEnum.WASTAGE_MEMO.getAttr(), CustomerManagementEnum.SEX.getAttr(),
            CustomerManagementEnum.QQ.getAttr(), CustomerManagementEnum.WE_CHRT.getAttr(), CustomerManagementEnum.GENRE.getAttr(), CustomerManagementEnum.IS_INDIVIDUAL.getAttr(), CustomerManagementEnum.SCALE.getAttr(),
            CustomerManagementEnum.INDUSTRY.getAttr(), CustomerManagementEnum.SOURCE.getAttr(), CustomerManagementEnum.WEBSITE.getAttr(), CustomerManagementEnum.INSTRUCTION.getAttr(), CustomerManagementEnum.COUNTRY.getAttr(),
            CustomerManagementEnum.HOBBIES.getAttr(), CustomerManagementEnum.MEMO.getAttr(), CustomerManagementEnum.ADD_TIME.getAttr(), CustomerManagementEnum.UPDATE_TIME.getAttr(),CustomerManagementEnum.BACK_NUM.getAttr()}),
    /**
     * 联系人 - businessType: 401
     *       NAME -> text_1 -> 姓名               PHONE -> subForm_1 -> 联系电话(不支持)      CUSTOMER_NAME -> text_2 -> 关联客户            EMAIL -> text_6 -> 邮箱                   QQ -> text_7 -> QQ                        ADDRESS -> address_1 -> 地址
     *       ZIP_CODE -> text_8 -> 邮编           SEX -> text_9 -> 性别                      BIRTHDAY -> text_14 -> 生日(不支持)            HOBBIES -> text_11 -> 爱好                MEMO -> text_12 -> 备注                    DEPARTMENT -> text_3 -> 部门
     *       POSITION -> text_4 -> 职务           LEVEL -> text_5 -> 级别                    IMPORTANT_DEGREE -> num_1 -> 重要程度(☆)      RELATIONSHIP -> text_10 -> 决策关系        INTIMATE_DEGREE -> num_3 -> 亲密度(☆)      CREATOR_ID -> creatorId -> 创建人(不支持)
     *       ADD_TIME -> addTime -> 创建时间      UPDATE_TIME -> updateTime -> 更新时间
     */
    CONTACT(XbbRefTypeEnum.CONTACT.getCode(), new String[]{ContactEnum.NAME.getAttr(), ContactEnum.CUSTOMER_NAME.getAttr(), ContactEnum.EMAIL.getAttr(), ContactEnum.QQ.getAttr(), ContactEnum.ADDRESS.getAttr(),
            ContactEnum.ZIP_CODE.getAttr(), ContactEnum.SEX.getAttr(), ContactEnum.HOBBIES.getAttr(), ContactEnum.MEMO.getAttr(), ContactEnum.DEPARTMENT.getAttr(),
            ContactEnum.POSITION.getAttr(), ContactEnum.LEVEL.getAttr(), ContactEnum.LEVEL.getAttr(), ContactEnum.RELATIONSHIP.getAttr(),
            ContactEnum.ADD_TIME.getAttr(), ContactEnum.UPDATE_TIME.getAttr()}),
    /**
     * 跟进记录 - businessType: 501
     *       CUSTOMER_NAME -> text_1 -> 客户名称        CONTACT_ARRAY -> text_3 -> 联系人          TYPE -> text_4 -> 跟进方式                          COMMUNICATE_TIME -> date_1 -> 拜访时间                COMMUNICATE_BUSINESS -> text_5 -> 跟进业务(不支持)                     MEMO -> text_6 -> 跟进内容(不支持)
     *       VIDEO -> file_4 -> 语音输入(不支持)         ADDRESS -> geo_1 -> 位置(不支持)           IMAGES -> file_1 -> 图片(不支持)                     FILE -> file_3 -> 附件(不支持)                        IF_REMIND -> num_3 -> 下次跟进提醒(不支持)                             NEXT_COMMUNICATE_TIME -> date_2 -> 下次跟进时间
     *       NOTIFY_TYPE -> text_20 -> 提醒(不支持)     NOTIFY_TIME -> date_3 -> 提醒时间(不支持)    NEXT_NOTIFY_MEMO -> text_21 -> 提醒备注(不支持)     ENTER_COMMUNICATE_PLAN -> num_4 -> 加入访客(不支持)     FINISH_COMMUNICATE_PLAN_ID -> text_7 -> 同步完成访客计划(不支持)       CREATOR_ID -> creatorId -> 创建人(不支持)
     *       ADD_TIME -> addTime -> 创建时间            UPDATE_TIME -> updateTime -> 更新时间
     */
    CUSTOMER_COMMUNICATE(XbbRefTypeEnum.CUSTOMER_COMMUNICATE.getCode(), new String[]{CustomerCommunicateEnum.CUSTOMER_NAME.getAttr(), CustomerCommunicateEnum.CONTACT_ARRAY.getAttr(), CustomerCommunicateEnum.TYPE.getAttr(), CustomerCommunicateEnum.COMMUNICATE_TIME.getAttr(),
            CustomerCommunicateEnum.ADD_TIME.getAttr(), CustomerCommunicateEnum.UPDATE_TIME.getAttr()}),
    /**
     * 销售机会 - businessType: 301
     *       NAME -> text_1 -> 销售机会名称                SERIAL_NO -> serialNo -> 销售机会编号      CUSTOMER_NAME -> text_3 -> 客户名称           CONTACT_NAME -> text_4 -> 客户联系人          SALE_STAGE -> text_17 -> 销售阶段           WASTAGE -> text_18 -> 输单原因
     *       WASTAGE_MEMO -> text_19 -> 输单备注          OWNER_ID -> ownerId -> 负责人(不支持)      COUSER_ID -> coUserId -> 协同人(不支持)        PRODUCTS -> array_1 -> 关联产品(不支持)        ESTIMATE_AMOUNT -> num_1 -> 预计金额        ESTIMATE_END_TIME -> date_1 -> 预计结束日期
     *       COST -> num_2 -> 机会成本                    GROSS_PROFIT -> num_3 -> 机会毛利         GROSS_PROFIT_RATE  -> num_4 -> 机会毛利率      IMPORTANT_DEGREE -> num_7 -> 重要程度(不支持)   DECISION_MAKER -> text_8 -> 决策人(不支持)   COMPETITOR -> text_9 -> 竞争对手
     *       CREATOR_ID -> creatorId -> 创建人(不支持)    ADD_TIME -> addTime -> 创建时间            UPDATE_TIME -> updateTime -> 更新时间
     */
    SALES_OPPORTUNITY(XbbRefTypeEnum.SALES_OPPORTUNITY.getCode(), new String[]{SalesOpportunityEnum.NAME.getAttr(), SalesOpportunityEnum.SERIAL_NO.getAttr(), SalesOpportunityEnum.CUSTOMER_NAME.getAttr(), SalesOpportunityEnum.CONTACT_NAME.getAttr(), SalesOpportunityEnum.SALE_STAGE.getAttr(), SalesOpportunityEnum.WASTAGE.getAttr(),
            SalesOpportunityEnum.WASTAGE_MEMO.getAttr(), SalesOpportunityEnum.ESTIMATE_AMOUNT.getAttr(), SalesOpportunityEnum.ESTIMATE_END_TIME.getAttr(),
            SalesOpportunityEnum.COST.getAttr(), SalesOpportunityEnum.GROSS_PROFIT.getAttr(), SalesOpportunityEnum.GROSS_PROFIT_RATE.getAttr(), SalesOpportunityEnum.COMPETITOR.getAttr(),
            SalesOpportunityEnum.ADD_TIME.getAttr(), SalesOpportunityEnum.UPDATE_TIME.getAttr()}),
    /**
     * 报价单 - businessType: 4700
     *       QUOTATION_NO -> serialNo -> 报价编号    NAME -> text_1 -> 报价名称                   CUSTOMER_ID -> text_2 -> 客户名称             CONTACT_ID -> text_3 -> 客户联系人          OPPORTUNITY_ID -> text_4 -> 关联机会      QUOTATION_PERSON -> text_5 -> 报价人
     *       QUOTATION_TIME -> date_1 -> 报价日期    EFFECTIVE_TIME -> date_2 -> 有效日期          STATUS -> text_6 -> 报价状态                 OWNER_ID -> ownerId -> 负责人(不支持)      MINOR_USER -> coUserId -> 协同人(不支持)    PRODUCT -> array_1 -> 关联产品(不支持)
     *       PRODUCT_TOTAL -> num_1 -> 产品合计      DISCOUNT -> num_2 -> 整单折扣率               OTHER_EXPENSE -> num_3 -> 其它费用           DISCOUNT_AMOUNT -> num_4 -> 优惠金额       AMOUNT -> num_5 -> 报价金额                ESTIMATE_COST -> num_6 -> 预估成本
     *       GROSS_PROFIT -> num_7 -> 预估毛利       GROSS_PROFIT_RATE -> num_8 -> 预估毛利率      CREATOR_ID -> creatorId -> 创建人(不支持)    ADD_TIME -> addTime -> 创建时间             UPDATE_TIME -> updateTime -> 更新时间
     */
    QUOTATION(XbbRefTypeEnum.QUOTATION.getCode(), new String[]{QuotationEnum.QUOTATION_NO.getAttr(), QuotationEnum.NAME.getAttr(), QuotationEnum.CUSTOMER_ID.getAttr(), QuotationEnum.CONTACT_ID.getAttr(), QuotationEnum.OPPORTUNITY_ID.getAttr(), QuotationEnum.QUOTATION_PERSON.getAttr(),
            QuotationEnum.QUOTATION_TIME.getAttr(), QuotationEnum.EFFECTIVE_TIME.getAttr(), QuotationEnum.STATUS.getAttr(),
            QuotationEnum.PRODUCT_TOTAL.getAttr(), QuotationEnum.DISCOUNT.getAttr(), QuotationEnum.OTHER_EXPENSE.getAttr(), QuotationEnum.DISCOUNT_AMOUNT.getAttr(), QuotationEnum.AMOUNT.getAttr(), QuotationEnum.ESTIMATE_COST.getAttr(),
            QuotationEnum.GROSS_PROFIT.getAttr(), QuotationEnum.GROSS_PROFIT_RATE.getAttr(), QuotationEnum.ADD_TIME.getAttr(), QuotationEnum.UPDATE_TIME.getAttr()}),
    /**
     * 合同订单 - businessType: 201
     *       CONTRACT_NO -> serialNo -> 合同编号            NAME -> text_1 -> 合同名称              LINK_CUSTOMER -> text_2 -> 客户名称         LINK_CONTACT -> text_3 -> 客户联系人                    LINK_OPPORTUNITY -> text_4 -> 关联机会      QUOTATION_ID -> text_66 -> 关联报价单      SIGN_PERSON -> text_8 -> 签订人
     *       SIGN_TIME -> date_1 -> 签订日期                DEADLINE -> date_2 -> 到期日期          STATUS -> text_6 -> 合同状态                OWNER_ID -> ownerId -> 负责人(不支持)                   MINOR_USER -> coUserId -> 协同人(不支持)     PRODUCT -> array_4 -> 关联产品(不支持)
     *       PRODUCT_TOTAL -> num_26 -> 产品合计            DISCOUNT -> num_38 -> 整单折扣率        OTHER_EXPENSE -> num_27 -> 其它费用     DISCOUNT_AMOUNT -> num_28 -> 优惠金额       AMOUNT -> num_1 -> 合同金额                            CONTRACT_COST -> num_2 -> 合同成本           GROSS_PROFIT -> num_25 -> 合同毛利
     *       GROSS_PROFIT_RATE -> num_3 -> 合同毛利率      CASH_PROFIT -> num_4 -> 现金毛利         CASH_PROFIT_RATE -> num_5 -> 现金毛利率     ADD_WRITE_OFF_PREPAYMENT -> button_1 -> 核销预收款      ADD_PAYMENT_SHEET -> button_2 -> 回款单     ADD_PAYMENT -> array_1 -> 回款计划
     *       LINK_PARTNER_CUSTOMER -> text_5 -> 合作客户   TYPE -> text_7 -> 合同类型              PAY_METHOD -> text_9 -> 付款方式            EXPRESS_STATUS -> text_10 -> 发货状态                   EXPRESS_NAME -> text_11 -> 物流公司         EXPRESS_NO -> text_12 -> 物流编号
     *       CREATOR_ID -> creatorId -> 创建人(不支持)      ADD_TIME -> addTime -> 创建时间         UPDATE_TIME -> updateTime -> 更新时间
     */
    CONTRACT(XbbRefTypeEnum.CONTRACT.getCode(), new String[]{ContractEnum.CONTRACT_NO.getAttr(), ContractEnum.NAME.getAttr(), ContractEnum.LINK_CUSTOMER.getAttr(), ContractEnum.LINK_CONTACT.getAttr(), ContractEnum.LINK_OPPORTUNITY.getAttr(), ContractEnum.QUOTATION_ID.getAttr(), ContractEnum.SIGN_PERSON.getAttr(),
            ContractEnum.SIGN_TIME.getAttr(), ContractEnum.DEADLINE.getAttr(), ContractEnum.STATUS.getAttr(),
            ContractEnum.PRODUCT_TOTAL.getAttr(), ContractEnum.DISCOUNT.getAttr(), ContractEnum.OTHER_EXPENSE.getAttr(), ContractEnum.DISCOUNT_AMOUNT.getAttr(), ContractEnum.AMOUNT.getAttr(), ContractEnum.CONTRACT_COST.getAttr(), ContractEnum.GROSS_PROFIT.getAttr(),
            ContractEnum.GROSS_PROFIT_RATE.getAttr(), ContractEnum.CASH_PROFIT.getAttr(), ContractEnum.CASH_PROFIT_RATE.getAttr(), ContractEnum.ADD_WRITE_OFF_PREPAYMENT.getAttr(), ContractEnum.ADD_PAYMENT_SHEET.getAttr(), ContractEnum.ADD_PAYMENT.getAttr(),
            ContractEnum.LINK_PARTNER_CUSTOMER.getAttr(), ContractEnum.TYPE.getAttr(), ContractEnum.PAY_METHOD.getAttr(), ContractEnum.EXPRESS_STATUS.getAttr(), ContractEnum.EXPRESS_NAME.getAttr(), ContractEnum.EXPRESS_NO.getAttr(),
            ContractEnum.ADD_TIME.getAttr(), ContractEnum.UPDATE_TIME.getAttr()}),
    /**
     * 退货退款 - businessType: 202
     *       REFUND_NO -> serialNo -> 退货退款单编号     CUSTOMER_ID -> text_1 -> 关联客户         CONTRACT_ID -> text_2 -> 关联合同           REFUND_NAME -> text_3 -> 退货退款合同名称      SIGN_USER -> text_13 -> 签订人          SIGN_DATE -> date_1 -> 签订日期
     *       OWNER_ID -> ownerId -> 负责人(不支持)      COUSERID -> coUserId -> 协同人(不支持)     PRODUCTS -> array_1 -> 退货产品(不支持)      RETURN_AMOUNT -> num_1 -> 退货金额            REFUND_REASON -> text_4 -> 退货原因     MEMO -> text_5 -> 退货备注
     *       PAYMENT_SHEETS -> text_6 -> 红冲回款单(不支持)     REFUND_AMOUNT -> num_2 -> 合计退款金额(该字段不可编辑，前端特殊逻辑控制，暂不处理)    INVOICES -> text_7 -> 红冲/作废发票(不支持)          CREATOR_ID -> creatorId -> 创建人(不支持)      ADD_TIME -> addTime -> 创建时间         UPDATE_TIME -> updateTime -> 更新时间
     */
    REFUND(XbbRefTypeEnum.REFUND.getCode(), new String[]{RefundEnum.REFUND_NO.getAttr(), RefundEnum.CUSTOMER_ID.getAttr(), RefundEnum.CONTRACT_ID.getAttr(), RefundEnum.REFUND_NAME.getAttr(), RefundEnum.SIGN_USER.getAttr(), RefundEnum.SIGN_DATE.getAttr(),
            RefundEnum.RETURN_AMOUNT.getAttr(), RefundEnum.REFUND_REASON.getAttr(), RefundEnum.MEMO.getAttr(),
            RefundEnum.ADD_TIME.getAttr(), RefundEnum.UPDATE_TIME.getAttr()}),
    /**
     * 销项发票 - businessType: 901
     *       SHEET_NO -> serialNo -> 编号                         INVOICE_NUMBER -> text_2 -> 发票号码            APPLY_USER -> ownerId -> 申请人(不支持，负责人字段)  CUSTOMER_NAME -> text_3 -> 关联客户          CONTRACT_ID -> text_4 -> 关联合同(不支持)    PAYMENT_RELATIONSHIP -> text_61 -> 关联回款类型(不支持)
     *       PAYMENT_ID -> text_5 -> 回款计划(不支持)              PAYMENT_SHEET_ID -> text_62 -> 回款单(不支持)    INVOICE_DATE -> date_1 -> 开票日期      TOTAL_MONEY -> num_2 -> 开票金额             INVOICE_TYPE -> text_6 -> 发票类型          CUSTOMER_INVOICE -> subForm_1 -> 发票信息(不支持)
     *       CUSTOMER_EXPRESS -> subForm_2 -> 寄送信息(不支持)     MEMO -> text_7 -> 备注                          ATTACHMENTS -> file_1 -> 附件(不支持)   CREATOR_ID -> creatorId -> 创建人(不支持)     ADD_TIME -> addTime -> 创建时间             UPDATE_TIME -> updateTime -> 更新时间
     */
    INVOICE(XbbRefTypeEnum.INVOICE.getCode(), new String[]{InvoiceEnum.SHEET_NO.getAttr(), InvoiceEnum.INVOICE_NUMBER.getAttr(), InvoiceEnum.CUSTOMER_NAME.getAttr(),
            InvoiceEnum.INVOICE_DATE.getAttr(), InvoiceEnum.TOTAL_MONEY.getAttr(), InvoiceEnum.INVOICE_TYPE.getAttr(),
            InvoiceEnum.MEMO.getAttr(), InvoiceEnum.ADD_TIME.getAttr(), InvoiceEnum.UPDATE_TIME.getAttr()}),
    /**
     * 进项发票 - businessType: 903
     *       SHEET_NO -> serialNo -> 编号                         INVOICE_NUMBER -> text_1 -> 发票号码        APPLY_USER -> ownerId -> 申请人              SUPPLIER_NAME -> text_2 -> 关联供应商      PURCHASE_ID -> text_3 -> 关联采购合同(不支持)      PAY_RELATIONSHIP -> text_4 -> 关联付款类型(不支持)
     *       PAY_PLAN_ID -> text_5 -> 付款计划(不支持)              PAY_SHEET_ID -> text_6 -> 付款单(不支持)    INVOICE_DATE -> date_1 -> 开票日期           TOTAL_MONEY -> num_1 -> 开票金额           INVOICE_TYPE -> text_7 -> 发票类型               CUSTOMER_INVOICE -> subForm_1 -> 发票信息(不支持)
     *       CUSTOMER_EXPRESS -> subForm_2 -> 寄送信息(不支持)      MEMO -> text_8 -> 备注                    ATTACHMENTS -> file_1 -> 附件(不支持)         CREATOR_ID -> creatorId -> 创建人(不支持)   ADD_TIME -> addTime -> 创建时间                 UPDATE_TIME -> updateTime -> 更新时间
     */
    PURCHASE_INVOICE(XbbRefTypeEnum.PURCHASE_INVOICE.getCode(), new String[]{PurchaseInvoiceEnum.SHEET_NO.getAttr(), PurchaseInvoiceEnum.INVOICE_NUMBER.getAttr(), PurchaseInvoiceEnum.APPLY_USER.getAttr(), PurchaseInvoiceEnum.SUPPLIER_NAME.getAttr(),
            PurchaseInvoiceEnum.INVOICE_DATE.getAttr(), PurchaseInvoiceEnum.TOTAL_MONEY.getAttr(), PurchaseInvoiceEnum.INVOICE_TYPE.getAttr(),
            PurchaseInvoiceEnum.MEMO.getAttr(), PurchaseInvoiceEnum.ADD_TIME.getAttr(), PurchaseInvoiceEnum.UPDATE_TIME.getAttr()}),
    /**
     * 回款单 - businessType: 702
     *     SHEET_NO -> serialNo -> 编号               PAYMENT_SHEET_TYPE -> text_10 -> 类型    CUSTOMER_ID -> text_6 -> 关联客户            CONTRACT -> text_4 -> 关联合同(不支持)    PAYMENT -> text_5 -> 关联回款计划(不支持)    AMOUNT -> num_1 -> 回款金额
     *     WRITE_OFF_AMOUNT -> num_7 -> 核销金额      INVOICE_AMOUNT -> num_8 -> 开票金额       BELONG_ID -> array_1 -> 归属人(不支持)       PAYMENT_TIME -> date_1 -> 回款日期        FUND_ACCOUNT -> text_14 -> 收款账户        PAY_METHOD -> text_3 -> 支付方式
     *     MEMO -> text_7 -> 备注                    FILE -> file_1 -> 附件(不支持)            CREATOR_ID -> creatorId -> 创建人(不支持)     ADD_TIME -> addTime -> 创建时间           UPDATE_TIME -> updateTime -> 更新时间
     */
    PAYMENT_SHEET(XbbRefTypeEnum.PAYMENT_SHEET.getCode(), new String[]{PaymentSheetEnum.SHEET_NO.getAttr(), PaymentSheetEnum.PAYMENT_SHEET_TYPE.getAttr(), PaymentSheetEnum.CUSTOMER_ID.getAttr(), PaymentSheetEnum.AMOUNT.getAttr(),
            PaymentSheetEnum.WRITE_OFF_AMOUNT.getAttr(), PaymentSheetEnum.INVOICE_AMOUNT.getAttr(), PaymentSheetEnum.PAYMENT_TIME.getAttr(), PaymentSheetEnum.FUND_ACCOUNT.getAttr(), PaymentSheetEnum.PAY_METHOD.getAttr(),
            PaymentSheetEnum.MEMO.getAttr(), PaymentSheetEnum.ADD_TIME.getAttr(), PaymentSheetEnum.UPDATE_TIME.getAttr()}),
    /**
     * 付款单 - businessType: 802
     *     PAY_PLAN_NO -> serialNo -> 付款单编号     PAY_SHEET_TYPE -> text_10 -> 类型      LINK_SUPPLIER -> text_4 -> 关联供应商       LINK_PURCHASE -> text_5 -> 关联采购合同(不支持)    PAY_PLAN -> text_6 -> 关联付款计划(不支持)     AMOUNT -> num_1 -> 付款金额
     *     WRITE_OFF_AMOUNT -> num_2 -> 核销金额     INVOICE_AMOUNT -> num_3 -> 开票金额    BELONG_ID -> array_1 -> 归属人(不支持)       REAL_PAY_TIME -> date_1 -> 付款日期              FUND_ACCOUNT -> text_13 -> 付款账户          PAY_TYPE -> text_2 -> 支付方式
     *     MEMO -> text_8 -> 备注                   FILE -> file_1 -> 附件(不支持)          CREATOR_ID -> creatorId -> 创建人(不支持)    ADD_TIME -> addTime -> 创建时间                 UPDATE_TIME -> updateTime -> 更新时间
     */
    PAY_SHEET(XbbRefTypeEnum.PAY_SHEET.getCode(), new String[]{PaySheetEnum.PAY_PLAN_NO.getAttr(), PaySheetEnum.PAY_SHEET_TYPE.getAttr(), PaySheetEnum.LINK_SUPPLIER.getAttr(), PaySheetEnum.AMOUNT.getAttr(),
            PaySheetEnum.WRITE_OFF_AMOUNT.getAttr(), PaySheetEnum.INVOICE_AMOUNT.getAttr(), PaySheetEnum.REAL_PAY_TIME.getAttr(), PaySheetEnum.FUND_ACCOUNT.getAttr(), PaySheetEnum.PAY_TYPE.getAttr(),
            PaySheetEnum.MEMO.getAttr(), PaySheetEnum.ADD_TIME.getAttr(), PaySheetEnum.UPDATE_TIME.getAttr()}),
    /**
     * 供应商 - businessType: 1001
     *       SUPPLIER_NAME -> text_1 -> 供应商名称         SHORT_NAME -> text_2 -> 供应商简称            PHONE -> subForm_1 -> 供应商电话(不支持)           OWNER_ID -> ownerId -> 负责人(不支持)       COUSERID -> coUserId -> 协同人(不支持)              THUMBNAIL -> file_1 -> 供应商图片(不支持)
     *       MEMO -> text_8 -> 备注                       PRODUCT_LIST -> array_1 -> 供货产品(不支持)    QUALITY_STANDARD -> num_1 -> 质量标准(不支持)     SUPPLY_COST -> num_2 -> 供货成本(不支持)     DELIVERY_CAPACITY -> num_3 -> 交货能力(不支持)      SERVER_CAPACITY -> num_4 -> 服务能力(不支持)
     *       CREDIT_LEVEL -> num_5 -> 信用等级(不支持)     REGISTERED_CAPITAL -> num_6 -> 注册资本       COUNTRY -> text_5 -> 国家                        ADDRESS -> address_1 -> 地址                WEBSITE -> text_6 -> 网站                         ANNUAL_OUTPUT -> num_7 -> 年产值
     *       CREATOR_ID -> creatorId -> 创建人(不支持)     ADD_TIME -> addTime -> 创建时间               UPDATE_TIME -> updateTime -> 更新时间
     */
    SUPPLIER(XbbRefTypeEnum.SUPPLIER.getCode(), new String[]{SupplierEnum.SUPPLIER_NAME.getAttr(), SupplierEnum.SHORT_NAME.getAttr(),
            SupplierEnum.MEMO.getAttr(),
            SupplierEnum.REGISTERED_CAPITAL.getAttr(), SupplierEnum.COUNTRY.getAttr(), SupplierEnum.ADDRESS.getAttr(), SupplierEnum.WEBSITE.getAttr(), SupplierEnum.ANNUAL_OUTPUT.getAttr(),
            SupplierEnum.ADD_TIME.getAttr(), SupplierEnum.UPDATE_TIME.getAttr()}),
    /**
     * 供应商联系人 - businessType: 1002
     *       NAME -> text_1 -> 姓名                       PHONE -> subForm_1 -> 联系电话(不支持)   SUPPLIER_ID -> text_2 -> 关联供应商     ADDRESS -> address_1 -> 地址      EMAIL -> text_6 -> 邮箱        QQ -> text_7 -> QQ
     *       SEX -> text_8 -> 性别                        BIRTHDAY -> text_14 -> 生日(不支持)     MEMO -> text_9 -> 备注                 DEPARTMENT -> text_3 -> 部门      POSITION -> text_4 -> 职务     LEVEL -> text_5 -> 级别
     *       CREATOR_ID -> creatorId -> 创建人(不支持)     ADD_TIME -> addTime -> 创建时间        UPDATE_TIME -> updateTime -> 更新时间
     */
    SUPPLIER_CONTACT(XbbRefTypeEnum.SUPPLIER_CONTACT.getCode(), new String[]{SupplierContactEnum.NAME.getAttr(), SupplierContactEnum.SUPPLIER_ID.getAttr(), SupplierContactEnum.ADDRESS.getAttr(), SupplierContactEnum.EMAIL.getAttr(), SupplierContactEnum.QQ.getAttr(),
            SupplierContactEnum.SEX.getAttr(), SupplierContactEnum.MEMO.getAttr(), SupplierContactEnum.DEPARTMENT.getAttr(), SupplierContactEnum.POSITION.getAttr(), SupplierContactEnum.LEVEL.getAttr(),
            SupplierContactEnum.ADDRESS.getAttr(), SupplierContactEnum.UPDATE_TIME.getAttr()}),
    /**
     * 供应商跟进记录 - businessType: 502
     *       SUPPLIER_ID -> text_1 -> 供应商名称      SUPPLIER_CONTACT -> text_3 -> 供应商联系人      TYPE -> text_4 -> 跟进方式           COMMUNICATE_TIME -> date_1 -> 拜访时间     COMMUNICATE_BUSINESS -> text_5 -> 跟进业务(不支持)      MEMO -> text_6 -> 跟进内容(不支持)
     *       VIDEO -> file_4 -> 语音输入(不支持)       ADDRESS -> geo_1 -> 位置(不支持)               IMAGES -> file_1 -> 图片(不支持)      FILE -> file_3 -> 附件(不支持)             CREATOR_ID -> creatorId -> 创建人(不支持)              ADD_TIME -> addTime -> 创建时间      UPDATE_TIME -> updateTime -> 更新时间
     */
    SUPPLIER_COMMUNICATE(XbbRefTypeEnum.SUPPLIER_COMMUNICATE.getCode(), new String[]{SupplierCommunicateEnum.SUPPLIER_ID.getAttr(), SupplierCommunicateEnum.SUPPLIER_CONTACT.getAttr(), SupplierCommunicateEnum.TYPE.getAttr(), SupplierCommunicateEnum.COMMUNICATE_TIME.getAttr(),
            SupplierCommunicateEnum.ADD_TIME.getAttr(), SupplierCommunicateEnum.UPDATE_TIME.getAttr()}),
    /**
     * 采购合同 - businessType: 1101
     *       SHEET_NO -> serialNo -> 采购合同编号            PURCHASE_NAME -> text_2 -> 采购合同名称             SUPPLIER_ID -> text_3 -> 供应商           PAY_METHOD -> text_4 -> 支付方式          STATUS -> text_5 -> 状态                                  SIGNER_ID -> text_6 -> 签订人
     *       SIGN_TIME -> date_1 -> 签订日期                ESTIMATE_ARRIVE_TIME -> date_2 -> 预计到货日期      MEMO -> text_8 -> 备注                    OWNER_ID -> ownerId -> 负责人(不支持)      COUSERID -> coUserId -> 协同人(不支持)                     PRODUCT -> array_3 -> 采购产品(不支持)
     *       PRODUCT_TOTAL -> num_5 -> 产品合计             DISCOUNT_MONEY -> num_3 -> 其他费用                DISCOUNT_AMOUNT -> num_6 -> 优惠金额      TOTAL_MONEY -> num_1 -> 采购金额(不支持)    ADD_WRITE_OFF_PREPAY -> button_1 -> 核销预付款(不支持)     ADD_PAY_SHEET -> button_2 -> 付款单(不支持)
     *       ADD_PAYPLAN -> array_2 -> 付款计划(不支持)      CREATOR_ID -> creatorId -> 创建人(不支持)          ADD_TIME -> addTime -> 创建时间            UPDATE_TIME -> updateTime -> 更新时间
     */
    PURCHASE(XbbRefTypeEnum.PURCHASE.getCode(), new String[]{PurchaseEnum.SHEET_NO.getAttr(), PurchaseEnum.PURCHASE_NAME.getAttr(), PurchaseEnum.SUPPLIER_ID.getAttr(), PurchaseEnum.PAY_METHOD.getAttr(), PurchaseEnum.STATUS.getAttr(), PurchaseEnum.SIGNER_ID.getAttr(),
            PurchaseEnum.SIGN_TIME.getAttr(), PurchaseEnum.ESTIMATE_ARRIVE_TIME.getAttr(), PurchaseEnum.MEMO.getAttr(),
            PurchaseEnum.PRODUCT_TOTAL.getAttr(), PurchaseEnum.DISCOUNT_MONEY.getAttr(), PurchaseEnum.DISCOUNT_AMOUNT.getAttr(),
            PurchaseEnum.ADD_TIME.getAttr(), PurchaseEnum.UPDATE_TIME.getAttr()}),
    /**
     * 采购退货单 - businessType: 1201
     *       SHEET_NO -> serialNo -> 采购退货单编号                LINK_SUPPLIER -> text_66 -> 供应商      PURCHASE_SHEET_ID -> text_2 -> 关联采购合同      MANAGER_ID -> ownerId -> 退货负责人(不支持)     TIME -> date_1 -> 退货日期                PRODUCTS -> array_1 -> 退货产品(不支持)
     *       TOTAL_MONEY -> num_1 -> 退货金额(不支持)              MEMO -> text_4 -> 备注                  CREATOR_ID -> creatorId -> 创建人(不支持)       ADD_TIME -> addTime -> 创建时间                UPDATE_TIME -> updateTime -> 更新时间     PAY_SHEETS -> text_68 -> 红冲付款单(不支持)
     *       RETURNED_PURCHASE_AMOUNT -> num_31 -> 合计退款金额   INVOICES -> text_69 -> 红冲/作废发票(不支持)
     */
    RETURNED_PURCHASE(XbbRefTypeEnum.RETURNED_PURCHASE.getCode(), new String[]{ReturnedPurchaseEnum.SHEET_NO.getAttr(), ReturnedPurchaseEnum.LINK_SUPPLIER.getAttr(), ReturnedPurchaseEnum.PURCHASE_SHEET_ID.getAttr(), ReturnedPurchaseEnum.TIME.getAttr(),
            ReturnedPurchaseEnum.MEMO.getAttr(), ReturnedPurchaseEnum.ADD_TIME.getAttr(), ReturnedPurchaseEnum.UPDATE_TIME.getAttr(), ReturnedPurchaseEnum.RETURNED_PURCHASE_AMOUNT.getAttr()}),
    /**
     * BOM 清单 - businessType: 2601
     *       SHEET_NO -> serialNo -> BOM编号             NAME -> text_2 -> BOM名称              STATUS -> text_3 -> BOM状态              MEMO -> text_7 -> 备注                        VERSION -> text_4 -> BOM版本(不支持)   PRODUCT -> array_1 -> 成品产品(不支持)
     *       MATERIEL -> array_2 -> 物料产品(不支持)      OWNER_ID -> ownerId -> 负责人(不支持)   COUSERID -> coUserId -> 协同人(不支持)     CREATOR_ID -> creatorId -> 创建人(不支持)      ADD_TIME -> addTime -> 创建时间       UPDATE_TIME -> updateTime -> 更新时间
     */
    BOM_BILL(XbbRefTypeEnum.BOM_BILL.getCode(), new String[]{BomBillEnum.SHEET_NO.getAttr(), BomBillEnum.NAME.getAttr(), BomBillEnum.STATUS.getAttr(), BomBillEnum.MEMO.getAttr(),
            BomBillEnum.ADD_TIME.getAttr(), BomBillEnum.UPDATE_TIME.getAttr()}),
    /**
     * 生产单 - businessType: 2801
     *       SHEET_NO -> serialNo -> 生产单编号          BOM_ID -> text_3 -> 关联BOM清单            BOM_VERSION -> text_4 -> 关联BOM版本      PLAN_TIME -> date_1 -> 计划完成日期      MEMO -> text_9 -> 备注                    INTO_WAREHOUSE_ID -> text_5 -> 入库仓库
     *       PRODUCT -> array_3 -> 成品产品(不支持)      OUT_WAREHOUSE_ID -> text_7 -> 出库仓库      MATERIEL -> array_4 -> 物料产品(不支持)   OWNER_ID -> ownerId -> 负责人(不支持)    COUSERID -> coUserId -> 协同人(不支持)      CREATOR_ID -> creatorId -> 创建人(不支持)
     *       ADD_TIME -> addTime -> 创建时间            UPDATE_TIME -> updateTime -> 更新时间
     */
    PRODUCTION_ORDER(XbbRefTypeEnum.PRODUCTION_ORDER.getCode(), new String[]{ProductionOrderEnum.SHEET_NO.getAttr(), ProductionOrderEnum.BOM_ID.getAttr(), ProductionOrderEnum.BOM_VERSION.getAttr(), ProductionOrderEnum.PLAN_TIME.getAttr(), ProductionOrderEnum.MEMO.getAttr(), ProductionOrderEnum.INTO_WAREHOUSE_ID.getAttr(),
            ProductionOrderEnum.OUT_WAREHOUSE_ID.getAttr(),
            ProductionOrderEnum.ADD_TIME.getAttr(), ProductionOrderEnum.UPDATE_TIME.getAttr()}),
    /**
     * 装配出入库单 - businessType: 1301
     *       SHEET_NO -> serialNo -> 装配单编号          MANAGER_ID -> ownerId -> 负责人(不支持)       ASSEMBLE_TIME -> date_1 -> 装配日期           MEMO -> text_3 -> 备注              OUT_WAREHOUSE_ID -> text_4 -> 出库仓库      OUT_PRODUCTS -> array_1 -> 出库产品(不支持)
     *       INTO_WAREHOUSE_ID -> text_6 -> 入库仓库    IN_PRODUCTS -> array_2 -> 入库产品(不支持)     CREATOR_ID -> creatorId -> 创建人(不支持)     ADD_TIME -> addTime -> 创建时间      UPDATE_TIME -> updateTime -> 更新时间
     */
    ASSEMBLE(XbbRefTypeEnum.ASSEMBLE.getCode(), new String[]{AssembleEnum.SHEET_NO.getAttr(), AssembleEnum.ASSEMBLE_TIME.getAttr(), AssembleEnum.MEMO.getAttr(), AssembleEnum.OUT_WAREHOUSE_ID.getAttr(),
            AssembleEnum.INTO_WAREHOUSE_ID.getAttr(), AssembleEnum.ADD_TIME.getAttr(), AssembleEnum.UPDATE_TIME.getAttr()}),
    /**
     * 盘点单 - businessType: 1701
     *      SHEET_NO -> serialNo -> 盘点单编号              WAREHOUSE_ID -> text_2 -> 仓库      MANAGER_ID -> ownerId -> 负责人(不支持)    TIME -> date_1 -> 盘点日期      PRODUCT -> array_1 -> 盘点产品(不支持)      MEMO -> text_5 -> 备注
     *      CREATOR_ID -> creatorId -> 创建人(不支持)       ADD_TIME -> addTime -> 创建时间      UPDATE_TIME -> updateTime -> 更新时间
     */
    INVENTORY(XbbRefTypeEnum.INVENTORY.getCode(), new String[]{InventoryEnum.SHEET_NO.getAttr(), InventoryEnum.WAREHOUSE_ID.getAttr(), InventoryEnum.TIME.getAttr(), InventoryEnum.MEMO.getAttr(),
            InventoryEnum.ADD_TIME.getAttr(), InventoryEnum.UPDATE_TIME.getAttr()}),
    /**
     * 调拨单 - businessType: 1601
     *       SHEET_NO -> serialNo -> 调拨单编号      OUT_WAREHOUSE_ID -> text_1 -> 调出仓库          INTO_WAREHOUSE_ID -> text_2 -> 调入仓库      MANAGER_NAME -> ownerId -> 负责人(不支持)      TRANSFER_TIME -> date_1 -> 调拨日期      PRODUCTS -> array_1 -> 调拨产品(不支持)
     *       MEMO -> text_3 -> 备注                 CREATOR_ID -> creatorId -> 创建人(不支持)        ADD_TIME -> addTime -> 创建时间             UPDATE_TIME -> updateTime -> 更新时间
     */
    TRANSFER(XbbRefTypeEnum.TRANSFER.getCode(), new String[]{TransferEnum.SHEET_NO.getAttr(), TransferEnum.OUT_WAREHOUSE_ID.getAttr(), TransferEnum.INTO_WAREHOUSE_ID.getAttr(), TransferEnum.TRANSFER_TIME.getAttr(),
            TransferEnum.MEMO.getAttr(), TransferEnum.ADD_TIME.getAttr(), TransferEnum.UPDATE_TIME.getAttr()}),
    /**
     * 采购入库单 - businessType: 1404
     *       SHEET_NO -> serialNo -> 采购入库编号      TIME -> date_1 -> 入库日期     SUPPLIER_ID -> text_66 -> 供应商             REF_ID -> text_5 -> 关联采购合同      WAREHOUSE_ID -> text_2 -> 入库仓库      PRODUCT -> array_1 -> 入库产品(不支持)
     *       MANAGER_ID -> ownerId -> 负责人(不支持)   MEMO -> text_7 -> 备注         CREATOR_ID -> creatorId -> 创建人(不支持)    ADD_TIME -> addTime -> 创建时间       UPDATE_TIME -> updateTime -> 更新时间
     */
    PURCHASE_INSTOCK(XbbRefTypeEnum.PURCHASE_INSTOCK.getCode(), new String[]{PurchaseInstockEnum.SHEET_NO.getAttr(), PurchaseInstockEnum.TIME.getAttr(), PurchaseInstockEnum.SUPPLIER_ID.getAttr(), PurchaseInstockEnum.REF_ID.getAttr(), PurchaseInstockEnum.WAREHOUSE_ID.getAttr(),
            PurchaseInstockEnum.MEMO.getAttr(), PurchaseInstockEnum.ADD_TIME.getAttr(), PurchaseInstockEnum.UPDATE_TIME.getAttr()}),
    /**
     * 销售退货入库单 - businessType: 1405
     *       SHEET_NO -> serialNo -> 销售退货入库编号    TIME -> date_1 -> 退货日期     CUSTOMER_ID -> text_66 -> 客户名称             REF_ID -> text_5 -> 关联退货退款      WAREHOUSE_ID -> text_2 -> 入库仓库      PRODUCT -> array_1 -> 入库产品(不支持)
     *       MANAGER_ID -> ownerId -> 负责人(不支持)    MEMO -> text_7 -> 备注         CREATOR_ID -> creatorId -> 创建人(不支持)      ADD_TIME -> addTime -> 创建时间       UPDATE_TIME -> updateTime -> 更新时间
     */
    REFUND_INSTOCK(XbbRefTypeEnum.REFUND_INSTOCK.getCode(), new String[]{RefundInstockEnum.SHEET_NO.getAttr(), RefundInstockEnum.TIME.getAttr(), RefundInstockEnum.CUSTOMER_ID.getAttr(), RefundInstockEnum.REF_ID.getAttr(), RefundInstockEnum.WAREHOUSE_ID.getAttr(),
            RefundInstockEnum.MEMO.getAttr(), RefundInstockEnum.ADD_TIME.getAttr(), RefundInstockEnum.UPDATE_TIME.getAttr()}),
    /**
     * 其他入库单 - businessType: 1406
     *       SHEET_NO -> serialNo -> 其他入库编号       TIME -> date_1 -> 入库日期      TYPE -> text_3 -> 业务类型                  REF_ID -> text_5 -> 关联单据(不支持)     WAREHOUSE_ID -> text_2 -> 入库仓库     PRODUCT -> array_1 -> 入库产品(不支持)
     *       MANAGER_ID -> ownerId -> 负责人(不支持)    MEMO -> text_7 -> 备注         CREATOR_ID -> creatorId -> 创建人(不支持)    ADD_TIME -> addTime -> 创建时间         UPDATE_TIME -> updateTime -> 更新时间
     */
    OTHER_INSTOCK(XbbRefTypeEnum.OTHER_INSTOCK.getCode(), new String[]{InstockEnum.SHEET_NO.getAttr(), InstockEnum.TIME.getAttr(), InstockEnum.TYPE.getAttr(), InstockEnum.WAREHOUSE_ID.getAttr(),
            InstockEnum.MEMO.getAttr(), InstockEnum.ADD_TIME.getAttr(), InstockEnum.UPDATE_TIME.getAttr()}),
    /**
     * 生产入库单 - businessType: 1407
     *       SHEET_NO -> serialNo -> 生产入库编号      TIME -> date_1 -> 入库日期                   REF_ID -> text_5 -> 关联生产单      WAREHOUSE_ID -> text_2 -> 入库仓库      PRODUCT -> array_1 -> 入库产品(不支持)      MANAGER_ID -> ownerId -> 负责人(不支持)
     *       MEMO -> text_7 -> 备注                   CREATOR_ID -> creatorId -> 创建人(不支持)    ADD_TIME -> addTime -> 创建时间     UPDATE_TIME -> updateTime -> 更新时间
     */
    PRODUCTION_INSTOCK(XbbRefTypeEnum.PRODUCTION_INSTOCK.getCode(), new String[]{ProductionInstockEnum.SHEET_NO.getAttr(), ProductionInstockEnum.TIME.getAttr(), ProductionInstockEnum.REF_ID.getAttr(), ProductionInstockEnum.WAREHOUSE_ID.getAttr(),
            ProductionInstockEnum.MEMO.getAttr(), ProductionInstockEnum.ADD_TIME.getAttr(), ProductionInstockEnum.UPDATE_TIME.getAttr()}),
    /**
     * 生产退料单 - businessType: 1408
     *       SHEET_NO -> serialNo -> 生产退料编号      TIME -> date_1 -> 退料日期                   REF_ID -> text_5 -> 关联生产单      WAREHOUSE_ID -> text_2 -> 入库仓库      PRODUCT -> array_1 -> 入库产品(不支持)      MANAGER_ID -> ownerId -> 负责人(不支持)
     *       MEMO -> text_7 -> 备注                   CREATOR_ID -> creatorId -> 创建人(不支持)    ADD_TIME -> addTime -> 创建时间     UPDATE_TIME -> updateTime -> 更新时间
     */
    RETURNED_MATERIEL_INSTOCK(XbbRefTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(), new String[]{ReturnedMaterielInstockEnum.SHEET_NO.getAttr(), ReturnedMaterielInstockEnum.TIME.getAttr(), ReturnedMaterielInstockEnum.REF_ID.getAttr(), ReturnedMaterielInstockEnum.WAREHOUSE_ID.getAttr(),
            ReturnedMaterielInstockEnum.MEMO.getAttr(), ReturnedMaterielInstockEnum.ADD_TIME.getAttr(), ReturnedMaterielInstockEnum.UPDATE_TIME.getAttr()}),
    /**
     * 销售出库单 - businessType: 1504
     *       SHEET_NO -> serialNo -> 销售出库编号             TIME -> date_1 -> 出库日期                          LINK_CUSTOMER -> text_66 -> 客户名称           REF_ID -> text_4 -> 关联合同订单        WAREHOUSE_ID -> text_2 -> 出库仓库      MANAGER_ID -> ownerId -> 负责人(不支持)
     *       PRODUCT -> array_1 -> 出库产品(不支持)           CUSTOMER_PHONE -> subForm_3 -> 客户电话(不支持)     CUSTOMER_ADDRESS -> address_2 -> 客户地址      EXPRESS_NAME -> text_7 -> 物流公司      EXPRESS_NO -> text_8 -> 物流单号       MEMO -> text_6 -> 备注
     *       CREATOR_ID -> creatorId -> 创建人(不支持)       ADD_TIME -> addTime -> 创建时间                     UPDATE_TIME -> updateTime -> 更新时间
     */
    CONTRACT_OUTSTOCK(XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(), new String[]{ContractOutstockEnum.SHEET_NO.getAttr(), ContractOutstockEnum.TIME.getAttr(), ContractOutstockEnum.LINK_CUSTOMER.getAttr(), ContractOutstockEnum.REF_ID.getAttr(), ContractOutstockEnum.WAREHOUSE_ID.getAttr(),
            ContractOutstockEnum.CUSTOMER_ADDRESS.getAttr(), ContractOutstockEnum.EXPRESS_NAME.getAttr(), ContractOutstockEnum.EXPRESS_NO.getAttr(), ContractOutstockEnum.MEMO.getAttr(),
            ContractOutstockEnum.ADD_TIME.getAttr(), ContractOutstockEnum.UPDATE_TIME.getAttr()}),
    /**
     * 采购退货出库单 - businessType: 1505
     *       SHEET_NO -> serialNo -> 采购退货出库编号    TIME -> date_1 -> 退货日期           LINK_SUPPLIER -> text_66 -> 供应商      REF_ID -> text_4 -> 关联采购退货      WAREHOUSE_ID -> text_2 -> 出库仓库           PRODUCT -> array_1 -> 出库产品(不支持)
     *       EXPRESS_NAME -> text_7 -> 物流公司         EXPRESS_NO -> text_8 -> 物流单号     MANAGER_ID -> ownerId -> 负责人(不支持)  MEMO -> text_6 -> 备注               CREATOR_ID -> creatorId -> 创建人(不支持)     ADD_TIME -> addTime -> 创建时间
     *       UPDATE_TIME -> updateTime -> 更新时间
     */
    RETURNED_PURCHASE_OUTSTOCK(XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), new String[]{ReturnedPurchaseOutstockEnum.SHEET_NO.getAttr(), ReturnedPurchaseOutstockEnum.TIME.getAttr(), ReturnedPurchaseOutstockEnum.LINK_SUPPLIER.getAttr(), ReturnedPurchaseOutstockEnum.REF_ID.getAttr(), ReturnedPurchaseOutstockEnum.WAREHOUSE_ID.getAttr(),
            ReturnedPurchaseOutstockEnum.EXPRESS_NAME.getAttr(), ReturnedPurchaseOutstockEnum.EXPRESS_NO.getAttr(), ReturnedPurchaseOutstockEnum.MEMO.getAttr(), ReturnedPurchaseOutstockEnum.ADD_TIME.getAttr(),
            ReturnedPurchaseOutstockEnum.UPDATE_TIME.getAttr()}),
    /**
     * 其他出库单 - businessType: 1506
     *       SHEET_NO -> serialNo -> 其他出库编号      TIME -> date_1 -> 出库日期           TYPE -> text_3 -> 业务类型                REF_ID -> text_4 -> 关联单据(不支持)      WAREHOUSE_ID -> text_2 -> 出库仓库            PRODUCT -> array_1 -> 出库产品(不支持)
     *       EXPRESS_NAME -> text_7 -> 物流公司       EXPRESS_NO -> text_8 -> 物流单号      MANAGER_ID -> ownerId -> 负责人(不支持)   MEMO -> text_6 -> 备注                   CREATOR_ID -> creatorId -> 创建人(不支持)     ADD_TIME -> addTime -> 创建时间
     *       UPDATE_TIME -> updateTime -> 更新时间
     */
    OTHER_OUTSTOCK(XbbRefTypeEnum.OTHER_OUTSTOCK.getCode(), new String[]{OutstockEnum.SHEET_NO.getAttr(), OutstockEnum.TIME.getAttr(), OutstockEnum.TYPE.getAttr(), OutstockEnum.WAREHOUSE_ID.getAttr(),
            OutstockEnum.EXPRESS_NAME.getAttr(), OutstockEnum.EXPRESS_NO.getAttr(), OutstockEnum.MEMO.getAttr(), OutstockEnum.ADD_TIME.getAttr(),
            OutstockEnum.UPDATE_TIME.getAttr()}),
    /**
     * 生产领料单 - businessType: 1507
     *       SHEET_NO -> serialNo -> 生产领料编号    TIME -> date_1 -> 领料日期               REF_ID -> text_4 -> 关联生产单       WAREHOUSE_ID -> text_2 -> 出库仓库             PRODUCT -> array_1 -> 出库产品(不支持)      EXPRESS_NAME -> text_7 -> 物流公司
     *       EXPRESS_NO -> text_8 -> 物流单号       MANAGER_ID -> ownerId -> 负责人(不支持)   MEMO -> text_6 -> 备注              CREATOR_ID -> creatorId -> 创建人(不支持)       ADD_TIME -> addTime -> 创建时间           UPDATE_TIME -> updateTime -> 更新时间
     */
    PRODUCTION_MATERIEL_OUTSTOCK(XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), new String[]{ProductionMaterielOutstockEnum.SHEET_NO.getAttr(), ProductionMaterielOutstockEnum.TIME.getAttr(), ProductionMaterielOutstockEnum.REF_ID.getAttr(), ProductionMaterielOutstockEnum.WAREHOUSE_ID.getAttr(), ProductionMaterielOutstockEnum.EXPRESS_NAME.getAttr(),
            ProductionMaterielOutstockEnum.EXPRESS_NO.getAttr(), ProductionMaterielOutstockEnum.MEMO.getAttr(), ProductionMaterielOutstockEnum.ADD_TIME.getAttr(), ProductionMaterielOutstockEnum.UPDATE_TIME.getAttr()}),
    /**
     * 工单出库 - businessType: 1508
     *      SHEET_NO -> serialNo -> 工单出库编号      TIME -> date_1 -> 出库日期            REF_ID  -> text_4 -> 关联工单                WAREHOUSE_ID -> text_2 ->  出库仓库           PRODUCT_INFO -> other_17 -> 产品信息      PRODUCT -> array_1 -> 出库产品(子表单，不支持)
     *      LINK_CUSTOMER -> text_66 -> 客户名称     LINK_CONTACT -> text_68 -> 联系人     CUSTOMER_PHONE -> subForm_3 -> 联系电话      CUSTOMER_ADDRESS -> address_2 -> 客户地址     EXPRESS_NAME  -> text_7 -> 物流公司       EXPRESS_NO  -> text_8 ->  物流单号
     *      MANAGER_ID -> ownerId -> 负责人(不支持)   MEMO -> text_6 -> 备注               CREATOR_ID -> creatorId -> 创建人            ADD_TIME -> addTime -> 创建时间               UPDATE_TIME -> updateTime -> 更新时间
     */
    /*WORK_ORDER_OUTSTOCK(XbbRefTypeEnum.WORK_ORDER_OUTSTOCK.getCode(), new String[]{WorkOrderOutstockEnum.SHEET_NO.getAttr(), WorkOrderOutstockEnum.TIME.getAttr(), WorkOrderOutstockEnum.REF_ID.getAttr(), WorkOrderOutstockEnum.WAREHOUSE_ID.getAttr(), WorkOrderOutstockEnum.PRODUCT_INFO.getAttr(), WorkOrderOutstockEnum.PRODUCT.getAttr(),
            WorkOrderOutstockEnum.LINK_CUSTOMER.getAttr(), WorkOrderOutstockEnum.LINK_CONTACT.getAttr(), WorkOrderOutstockEnum.CUSTOMER_PHONE.getAttr(), WorkOrderOutstockEnum.CUSTOMER_ADDRESS.getAttr(), WorkOrderOutstockEnum.EXPRESS_NAME.getAttr(), WorkOrderOutstockEnum.EXPRESS_NO.getAttr(),
            WorkOrderOutstockEnum.MANAGER_ID.getAttr(), WorkOrderOutstockEnum.MEMO.getAttr(), WorkOrderOutstockEnum.CREATOR_ID.getAttr(), WorkOrderOutstockEnum.ADD_TIME.getAttr(), WorkOrderOutstockEnum.UPDATE_TIME.getAttr()}),*/
    /**
     * 仓库 - businessType: 1801
     *      WAREHOUSE_NAME -> text_1 -> 仓库名称            WAREHOUSE_NO -> serialNo -> 仓库编号            ADDRESS -> address_1 -> 地址      MANAGER_DEP_ID -> array_1 -> 负责部门(不支持)     MANAGER_ID -> array_2 -> 负责人(不支持)   MEMO -> text_5 -> 备注
     *      ORI_STOCK -> text_70 -> 期初库存(不支持)        CREATOR_ID -> creatorId -> 创建人(不支持)        ADD_TIME -> addTime -> 创建时间    UPDATE_TIME -> updateTime -> 更新时间
     */
    WAREHOUSE(XbbRefTypeEnum.WAREHOUSE.getCode(), new String[]{WarehouseEnum.WAREHOUSE_NAME.getAttr(), WarehouseEnum.WAREHOUSE_NO.getAttr(), WarehouseEnum.ADDRESS.getAttr(), WarehouseEnum.MEMO.getAttr(),
            WarehouseEnum.ADD_TIME.getAttr(), WarehouseEnum.UPDATE_TIME.getAttr()}),

    /**
     * 市场活动 - businessType: 8100
     *      NAME -> text_1 -> 活动名称   START_TIME -> date_1 -> 开始时间            END_TIME -> date_2 -> 结束时间      GENRE -> text_2 -> 活动类型   ESTIMATE_COST -> num_1 -> 预计成本   REAL_COST -> num_2 -> 实际成本
     *      ESTIMATE_INCOME -> num_3 -> 预计收入        REAL_INCOME -> creatorId -> num_4        STATUS -> text_3 -> 活动状态    CAPTION -> text_4 -> 活动说明    MEMO -> text_5 -> 备注
     *      ADD_TIME -> addTime -> 创建时间        UPDATE_TIME -> updateTime -> 更新时间
     */
    MARKET_ACTIVITY(XbbRefTypeEnum.MARKET_ACTIVITY.getCode(), new String[]{MarketActivityEnum.NAME.getAttr(), MarketActivityEnum.START_TIME.getAttr(), MarketActivityEnum.END_TIME.getAttr(), MarketActivityEnum.GENRE.getAttr(),
            MarketActivityEnum.ESTIMATE_COST.getAttr(), MarketActivityEnum.REAL_COST.getAttr(), MarketActivityEnum.ESTIMATE_INCOME.getAttr(), MarketActivityEnum.REAL_INCOME.getAttr(), MarketActivityEnum.STATUS.getAttr(), MarketActivityEnum.CAPTION.getAttr(),
            MarketActivityEnum.MEMO.getAttr(), MarketActivityEnum.ADD_TIME.getAttr(), MarketActivityEnum.UPDATE_TIME.getAttr()}),

    /**
     * 线索 - businessType: 8000
     *      COMPANY_NAME -> text_1 -> 企业名称   CONTACT -> text_2 -> 联系人    MARKET_ACTIVITY_ID -> text_3 -> 关联市场活动      CLUE_SOURCE -> text_4 -> 线索来源   CLUE_STATUS -> text_5 -> 线索状态   CLUE_STAGE -> text_6 -> 线索阶段
     *      INVALID_REASON -> text_7 -> 无效原因   INVALID_MEMO -> text_8 -> 无效备注     MEMO -> text_9 -> 备注    ADD_TIME -> addTime -> 创建时间    UPDATE_TIME -> updateTime -> 更新时间
     *      SCORE -> num_1 -> 评分    LAST_CONNECT_TIME -> date_1 -> 最后更新时间      DISTRIBUTION_DATE -> date_3 -> 分配时间
     */
    CLUE(XbbRefTypeEnum.CLUE.getCode(), new String[]{ClueEnum.COMPANY_NAME.getAttr(), ClueEnum.CONTACT.getAttr(), ClueEnum.MARKET_ACTIVITY_ID.getAttr(), ClueEnum.CLUE_SOURCE.getAttr(),
            ClueEnum.CLUE_STATUS.getAttr(), ClueEnum.CLUE_STAGE.getAttr(), ClueEnum.INVALID_REASON.getAttr(), ClueEnum.INVALID_MEMO.getAttr(), ClueEnum.MEMO.getAttr(),
            ClueEnum.ADD_TIME.getAttr(), ClueEnum.UPDATE_TIME.getAttr(), ClueEnum.SCORE.getAttr(), ClueEnum.LAST_CONNECT_TIME.getAttr(),  ClueEnum.DISTRIBUTION_DATE.getAttr(),ClueEnum.BACK_NUM.getAttr()}),
    /**
     * 工单 - businessType：2301
     *
     */
    WORK_ORDER(XbbRefTypeEnum.WORK_ORDER.getCode(), new String[]{WorkOrderEnum.SHEET_NO.getAttr(), WorkOrderEnum.NAME.getAttr(), WorkOrderEnum.LINK_CUSTOMER.getAttr(), WorkOrderEnum.LINK_CONTACT.getAttr(), WorkOrderEnum.LINK_OPPORTUNITY.getAttr(), WorkOrderEnum.LINK_CONTRACT.getAttr(), WorkOrderEnum.SERVICE_PRICE.getAttr(), WorkOrderEnum.IMPLEMENTATION_TIME.getAttr(), WorkOrderEnum.MEMO.getAttr(), WorkOrderEnum.EMERGENCY_LEVEL.getAttr(), WorkOrderEnum.ADD_TIME.getAttr(), WorkOrderEnum.UPDATE_TIME.getAttr()}),

    /**
     * 竞争对手
     */
    COMPETITOR(XbbRefTypeEnum.COMPETITOR.getCode(),new String[]{CompetitorEnum.NAME.getAttr(),CompetitorEnum.SCALE.getAttr(),CompetitorEnum.INSTRUCTION.getAttr(),CompetitorEnum.ADDRESS.getAttr(),CompetitorEnum.WEBSITE.getAttr(),CompetitorEnum.ADD_TIME.getAttr(),CompetitorEnum.UPDATE_TIME.getAttr()}),

    /**
     * 工单v2
     */
    WORK_ORDER_V2(XbbRefTypeEnum.WORK_ORDER_V2.getCode(),new String[]{FieldTypeEnum.SERIALNO.getAlias(), "text_1", "text_2", "text_3", "date_1", "date_2", "address_1", "text_4", "date_5", "num_7", "date_7", "num_1", "text_8", "text_9", "text_10", "num_2", "text_11", "text_12", "num_3",  FieldTypeEnum.ADDTIME.getAlias(), FieldTypeEnum.UPDATETIME.getAlias()}),

    /**
     * 回执单
     */
    RECEIPT_ORDER(XbbRefTypeEnum.RECEIPT_ORDER.getCode(),new String[]{FieldTypeEnum.SERIALNO.getAlias(), "text_1", "text_2", "text_3","num_1", "num_2", "num_3",  "text_5", FieldTypeEnum.ADDTIME.getAlias(), FieldTypeEnum.UPDATETIME.getAlias()}),
    /**
     * 服务项目
     */
    SERVICE_PROJECT(XbbRefTypeEnum.SERVICE_PROJECT.getCode(),new String[]{FieldTypeEnum.SERIALNO.getAlias(), "text_1", "text_2", "num_1", "num_2",  FieldTypeEnum.ADDTIME.getAlias(), FieldTypeEnum.UPDATETIME.getAlias()}),

    ;

    /**
     * 业务类型
     */
    private int code;

    /**
     * 字段数组
     */
    private String[] attrArray;

    RuleConditionBusinessFieldEnum (int code, String[] attrArray) {
        this.code = code;
        this.attrArray = attrArray;
    }

    /**
     * 根据业务类型查询所有字段
     * @param code
     * @return
     */
    public static JSONArray getAttrsByCode (Integer code) {
        JSONArray array = new JSONArray();
        for (RuleConditionBusinessFieldEnum cacheCode : values()) {
            if (Objects.equals(code, cacheCode.getCode())) {
                String[] attrArray = cacheCode.getAttrArray();
                array = JSONArray.parseArray(JSON.toJSONString(attrArray));
                return array;
            }
        }
        return array;
    }
}
